﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using log4net;

namespace MiniSched.Logging.Log4Net {
    
    internal class Log4NetLog : MiniSchedLog {

        public ILog Log { get { return _Log; } }
        private readonly ILog _Log;

        public Log4NetLog(ILog log) {
            if (null == log) throw new ArgumentNullException("log");
            _Log = log;
        }

        public override bool IsDebugEnabled {
            get { return Log.IsDebugEnabled; }
        }

        public override bool IsInfoEnabled {
            get { return Log.IsInfoEnabled; }
        }

        public override bool IsWarnEnabled {
            get { return Log.IsWarnEnabled; }
        }

        public override bool IsErrorEnabled {
            get { return Log.IsErrorEnabled; }
        }

        public override bool IsFatalEnabled {
            get { return Log.IsFatalEnabled; }
        }

        public override void Debug(object message, Exception exception) {
            Log.Debug(message, exception);
        }

        public override void Info(object message, Exception exception) {
            Log.Info(message, exception);
        }

        public override void Warn(object message, Exception exception) {
            Log.Warn(message, exception);
        }

        public override void Error(object message, Exception exception) {
            Log.Error(message, exception);
        }

        public override void Fatal(object message, Exception exception) {
            Log.Fatal(message, exception);
        }
    }
}
